<%@ page contentType="text/html;charset=UTF-8" %>
<%@ page import="org.apache.shiro.web.filter.authc.FormAuthenticationFilter"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>井下钻孔 · 三维展示与统计系统登录</title>
	<meta name="decorator" content="blank"/>
	<link href="${ctxStatic}/css/login.css" type="text/css" rel="stylesheet"></link>
    <script src="${ctxStatic}/js/sand.js" type="text/javascript"></script>
	<script type="text/javascript">
		$(document).ready(function() {
			$("#loginForm").validate({
				rules: {
					validateCode: {remote: "${pageContext.request.contextPath}/servlet/validateCodeServlet"}
				},
				messages: {
					username: {required: "请填写用户名."},password: {required: "请填写密码."},
					validateCode: {remote: "验证码不正确.", required: "请填写验证码."}
				},
				errorLabelContainer: "#messageBox",
				errorPlacement: function(error, element) {
					error.appendTo($("#loginError").parent());
				} 
			});
		});
		// 如果在框架或在对话框中，则弹出提示并跳转到首页
		if(self.frameElement && self.frameElement.tagName == "IFRAME" || $('#left').length > 0 || $('.jbox').length > 0){
			alert('未登录或登录超时。请重新登录，谢谢！');
			top.location = "${ctx}";
		}
	</script>
</head>
<body>
	<div class="header">
		<div id="messageBox" class="alert alert-error ${empty message ? 'hide' : ''}"><button data-dismiss="alert" class="close">×</button>
			<label id="loginError" class="error">${message}</label>
		</div>
	</div>
	<form id="loginForm" class="content" action="${ctx}/login" method="post">
		<div class="bidTitle">井下钻孔 · 三维展示与统计系统</div>
		<div class="logCon">
			<span>账号:</span>
			<input type="text" id="username" name="username"  class="bt_input required" value="${username}" autocomplete="off">
			<span>密码:</span>
			<input type="password" id="password" name="password" class="bt_input required">
			<input class="logingBut" type="submit" value="登 录"/>
			<!-- <button type="button" class="logingBut">登录</button> -->
		</div>
	</form>
	<script src="${ctxStatic}/js/login.js" type="text/javascript"></script>
	<script>
		loop1();
	</script>
</body>
</html>